package com.jams.goodox.net.services;

import com.jams.goodox.constant.UrlConstants;
import com.jams.goodox.entity.Bill;
import com.jams.goodox.entity.BillDetail;
import com.jams.goodox.entity.CommentBean;
import com.jams.goodox.entity.CompanyListResp;
import com.jams.goodox.entity.HeadImgBean;
import com.jams.goodox.entity.MoneyPayResultInfo;
import com.jams.goodox.entity.MyActivityList;
import com.jams.goodox.entity.MyRedPacket;
import com.jams.goodox.entity.MyServiceAddress;
import com.jams.goodox.entity.PayWayBean;
import com.jams.goodox.entity.PointBuyProductResult;
import com.jams.goodox.entity.PointOrderDetail;
import com.jams.goodox.entity.PointProduct;
import com.jams.goodox.entity.PointProductDetail;
import com.jams.goodox.entity.PointRecord;
import com.jams.goodox.entity.RechargeFeedbackBean;
import com.jams.goodox.entity.RechargeRedPacketsInfo;
import com.jams.goodox.entity.RechargeThirdPayResultBean;
import com.jams.goodox.entity.RedPoint;
import com.jams.goodox.entity.ServiceAddressAddResult;
import com.jams.goodox.entity.StringBean;
import com.jams.goodox.entity.Suggestion;
import com.jams.goodox.entity.SuggestionDetail;
import com.jams.goodox.entity.UpdateEntity;
import com.jams.goodox.entity.UploadImgResult;
import com.jams.goodox.entity.UserNoticeSet;
import com.jams.goodox.entity.resp.CooperationResp;
import com.jams.goodox.entity.resp.GetAddressResp;
import com.jams.goodox.entity.resp.MyRecommendResp;
import com.jams.goodox.entity.resp.UserInfoResp;
import com.jams.goodox.net.BaseEntity;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

/**
 * Created by Jin on 2016/5/14.
 * Description 模块：我的 接口
 */
public interface MineService {

	// 修改头像
	@Multipart
	@POST(UrlConstants.PERSONAL_SETTINGS+ "pic")
	Call<HeadImgBean> modifyPic(@PartMap Map<String, RequestBody> names);

	// 修改昵称
	@PUT(UrlConstants.PERSONAL_SETTINGS + "nickName/{nickName}")
	Call<BaseEntity> modifyNickName(@Path("nickName") String nickName);

	// 修改性别
	@PUT(UrlConstants.PERSONAL_SETTINGS + "sex/{sex}")
	Call<BaseEntity> modifyUserSex(@Path("sex") String sex);

	// 修改电话
	@PUT(UrlConstants.editUserPhone)
	Call<BaseEntity> editUserPhone(@QueryMap Map<String, String> names);

	// 修改生日
	@PUT(UrlConstants.PERSONAL_SETTINGS + "birthday/{birthday}")
	Call<BaseEntity> modifyUserBirthday(@Path("birthday") String birthday);


	//-------------服务地址---------------------
	// 删除服务地址
	@DELETE(UrlConstants.SERVICE_ADDRESS + "{id}")
	Call<BaseEntity> delAddress(@Path("id") String id);

	// 我的服务地址
	@GET(UrlConstants.SERVICE_ADDRESS + "my")
	Call<MyServiceAddress> myServiceAddress(@Query("subId") String subId);

	//-------------获取用户基本信息-----------------------
	@FormUrlEncoded
	@POST(UrlConstants.MyInfo)
	Call<UserInfoResp> getBaseUserInfo(@Field("memberId") String memberId);
	//-------------我的红包-----------------------
	@GET("v10/sr/myRedPacketList")
	Call<MyRedPacket> getMyRedPacketList(@QueryMap Map<String, String> names);

	//-------------我的积分--------------------
	// 积分记录列表
	@GET(UrlConstants.POINT + "list")
	Call<PointRecord> pointLogList(@Query("curPage") int curPage, @Query("pageSize") int pageSize, @Query("filter") int filter);

	// 积分商品详情
	@GET(UrlConstants.POINT  + "product/detail/{productId}")
	Call<PointProductDetail> productDetail(@Path("productId") String productId);

	// 积分商品列表
	@GET(UrlConstants.POINT  + "product/list/{communityId}")
	Call<PointProduct> getProductList(@Path("communityId") String communityId, @QueryMap Map<String, String> names);

	// 积分兑换订单详情
	@GET(UrlConstants.POINT  + "order/{orderId}")
	Call<PointOrderDetail> orderDetail(@Path("orderId") String orderId);

	// 积分兑换订单提交
	@POST(UrlConstants.POINT  + "product/buy")
	Call<PointBuyProductResult> productBuy(@QueryMap Map<String, String> names);

	//-------------意见反馈--------------------
	@Multipart
	@POST(UrlConstants.APP_VERSION + "upload/advice")
	Call<UploadImgResult> submitSuggestionPics(@Part List<MultipartBody.Part> partList);

	@POST(UrlConstants.suggestion + "advice/{type}")
	Call<BaseEntity> submitSuggestion(@Path("type") String type, @QueryMap Map<String, String> names);

	@GET(UrlConstants.suggestion + "advice/{type}/my")
	Call<Suggestion> getSuggestion(@Path("type") String type, @QueryMap Map<String, String> names);

	@GET(UrlConstants.suggestion + "advice/{id}")
	Call<SuggestionDetail> getSuggestionDetail(@Path("id") String id);

	//-----------app version
	@GET(UrlConstants.appVersion + "{mtype}")
	Call<UpdateEntity> getAppVersion(@Path("mtype") String mtype);

	//-----------我的账单
	@GET(UrlConstants.BILL+"list")
	Call<Bill> getBillList(@QueryMap Map<String, String> names);

	@GET(UrlConstants.BILL + "detail/{id}")
	Call<BillDetail> getBillDetail(@Path("id") String id);

	// 获取园区列表
	@GET(UrlConstants.PERSONAL_SETTINGS + "myNotice")
	Call<UserNoticeSet> getUserNoticeSet();

	// 获取园区列表
	@PUT(UrlConstants.PERSONAL_SETTINGS + "userNotice/{type}")
	Call<BaseEntity> userNoticeSet(@Path("type") String type);

	// 获取可充值面额列表
	@GET(UrlConstants.RECHARGE + "rechargeActivity")
	Call<RechargeFeedbackBean> rechargeActivity();

	// 第三方支付充值
	@POST(UrlConstants.RECHARGE + "{moneyChange}")
	Call<RechargeThirdPayResultBean> recharge(@Path("moneyChange") String moneyChange, @Query("rechargeActivityId") String rechargeActivityId);

	// 获取充值方式
	@GET(UrlConstants.RECHARGE + "types")
	Call<PayWayBean> types();

	// 充值后获取赠送的红包
	@GET(UrlConstants.RECHARGE + "redPacketByRechargeId/{rechargeId}")
	Call<RechargeRedPacketsInfo> redPacketByRechargeId(@Path("rechargeId") String rechargeId);

	// 我的余额
	@GET(UrlConstants.ACCOUNT + "balance")
	Call<StringBean> balance(@Query("userId") String userId);

	// 获取支付密码验证码
	@GET(UrlConstants.ACCOUNT + "sendCode/{phone}")
	Call<BaseEntity> sendPayCode(@Path("phone") String phone);

	// 设置支付密码
	@PUT(UrlConstants.ACCOUNT + "payPwd")
	Call<BaseEntity> setPayPwd(@Query("code") String code, @Query("pwd") String pwd, @Query("phone") String phone);

	// 余额支付
	@POST(UrlConstants.ACCOUNT + "payByBalance")
	Call<MoneyPayResultInfo> payByBalance(@Query("userId") String userId,@Query("balance") String balance, @Query("orderId") String orderId, @Query("password") String password,@Query("subCode") String paySubCode);

	// 判断是否支付成功
	@GET(UrlConstants.ACCOUNT + "payStatus/{orderId}/{type}")
	Call<StringBean> payStatus(@Path("orderId") String orderId, @Path("type") String type);

	// 验证验证码
	@PUT(UrlConstants.ACCOUNT + "verifyCode/{phone}/{code}")
	Call<BaseEntity> verifyCode(@Path("phone") String phone, @Path("code") String code);


	@POST("api/question/own")
	Call<BaseEntity> queueQuestion(@Body RequestBody requestBody);

	@POST("api/course/teacher")
	Call<BaseEntity> teacherManager(@Body RequestBody requestBody);


	@POST("api/question/detail")
	Call<BaseEntity> queueQuestionDetail(@Body RequestBody requestBody);

	@POST("api/personal/center")
	Call<BaseEntity> queueUserInfo(@Body RequestBody requestBody);

	@POST("api/message/list")
	Call<BaseEntity> queueMessage(@Body RequestBody requestBody);

	@POST("api/course/own")
	Call<BaseEntity> queueBuy(@Body RequestBody requestBody);


	@POST("api/course/add")
	Call<BaseEntity> uploadRecord(@Body RequestBody requestBody);


	@POST("api/coin/list")
	Call<BaseEntity> getOx(@Body RequestBody requestBody);

	@POST("api/coin/recharge")
	Call<BaseEntity> createOrder(@Body RequestBody requestBody);

	@POST("api/pay/placeOrder")
	Call<ResponseBody> getWXInfo(@Body RequestBody requestBody);

	@POST("api/coin/detail")
	Call<BaseEntity> getOxOrder(@Body RequestBody requestBody);

	//关联企业
	@Headers({"Content-Type: application/json","Accept: application/json"})
	@PUT(UrlConstants.connectCompany)
	Call<BaseEntity> connectCompany(@Field("communityId")String communityId,@Field("enterpriseId")String enterpriseId,
									@Field("userName") String userName);

	//获取园区所在区域id
	@GET(UrlConstants.getCommunityAddress)
	Call<GetAddressResp> getAddress(@Query("communityId") String communityId);

	//我的互动 我发布的
	@GET( UrlConstants.publishInteraction)
	Call<CooperationResp> myPublishInteraction(@Query("curPage") int curPage, @Query("pageSize") int pageSize);
	//我参与的 我报名的
	@GET( UrlConstants.applyInteraction)
	Call<MyActivityList> myApplyInteraction(@Query("curPage") int curPage, @Query("pageSize") int pageSize);
	//我的评论
	@GET(UrlConstants.noticeInteraction)
	Call<CommentBean>myNoticeInteraction(@Query("curPage") int curPage, @Query("pageSize") int pageSize);
	//我的推荐
	@GET(UrlConstants.recommendInteraction)
	Call<MyRecommendResp> MyRecommendInteraction(@Query("curPage") int curPage, @Query("pageSize") int pageSize);


}
